//
// Created by mnutec on 2021/2/28.
//

#include <iostream>
#include<iterator>
using namespace std;

int main(){
    int arr[3][3]={{1,2,3},{4,5,6},{7,8,9}};

    for(int i=0;i<3;i++){
        for(int j=1-i;j>=0;j--){
            swap(arr[i][j],arr[2-j][2-i]);
        }
    }

    for(int i=0;i<3;i++){
        swap(arr[0][i],arr[2][i]);
    }
    copy(&arr[0][0],&arr[0][3],ostream_iterator<int>(cout, " "));
    cout<<endl;
    copy(&arr[1][0],&arr[1][3],ostream_iterator<int>(cout, " "));
    cout<<endl;
    copy(&arr[2][0],&arr[2][3],ostream_iterator<int>(cout, " "));
    return 0;
}